- selected_r = @project.selected_rewards
.section.project-metrics
  .w-container
    .w-row
      .w-col.w-col-8.u-marginbottom-30
        .fontsize-base.u-marginbottom-40
          p.fontweight-bold Total de apoios confirmados por dia
          = line_chart @metrics[:confirmed]
        .fontsize-base.u-marginbottom-60
          p.fontweight-bold Total arrecadado por dia
          = line_chart @metrics[:confirmed_amount_by_day]
        .fontsize-base.u-marginbottom-40
          p.fontweight-bold Total de apoios confirmado por Estado
        .w-row.card.fontsize-base.fontweight-semibold.card-secondary
          .w-col.w-col-6.w-col-small-6.w-col-tiny-6
            div Estado
          .w-col.w-col-6.w-col-small-6.w-col-tiny-6
            div Total de apoio confirmado
        - @metrics[:address_state].sort{|a,b| b[1] <=> a[1]}.each do |metric|
          .w-row.card.fontsize-base
            .w-col.w-col-6.w-col-small-6.w-col-tiny-6
              div= metric[0] || 'Internacional'
            .w-col.w-col-6.w-col-small-6.w-col-tiny-6
              div= metric[1]
        .u-marginbottom-40.u-margintop-40
          .fontsize-base.fontweight-bold Total de usuários que clicaram no botão Lembrar-me
          .fontsize-smaller Esses usuários receberão um lembrete por email 48 horas antes do término de sua campanha
          = @project.total_reminders
      .w-col.w-col-4
        .card.u-radius.u-marginbottom-20.card-terciary data-ix="new-interaction" 
          .fontsize-small.fontweight-semibold.u-marginbottom-20
            span.fa.fa-download 
            | Baixar relatórios
          ul.w-list-unstyled
            li.fontsize-smaller.u-marginbottom-10
              div
                | Apoiadores confirmados &nbsp;
                = link_to 'CSV', reports_contribution_reports_for_project_owners_path(project_id: @project.id, format: :csv), class: 'alt-link'
                | &nbsp;\&nbsp;
                = link_to 'XLS', reports_contribution_reports_for_project_owners_path(project_id: @project.id, format: :xls), class: 'alt-link'
            li.divider.u-marginbottom-10
            li.fontsize-smaller.u-marginbottom-10
              div
                | Apoiadores pendentes&nbsp;&nbsp;
                = link_to 'CSV', reports_contribution_reports_for_project_owners_path(project_id: @project.id, state: 'pending', waiting_payment: 'true', format: :csv), class: 'alt-link'
                | &nbsp;\&nbsp;
                = link_to 'XLS', reports_contribution_reports_for_project_owners_path(project_id: @project.id, state: 'pending', waiting_payment: 'true', format: :xls), class: 'alt-link'
            li.divider.u-marginbottom-10
            li.fontsize-smaller.u-marginbottom-10
              div
                | Apoiadores que não selecionaram recompensa&nbsp;&nbsp;
                = link_to 'CSV', reports_contribution_reports_for_project_owners_path(project_id: @project.id, reward_id: 0, format: :csv), class: 'alt-link'
                | &nbsp;\&nbsp;
                = link_to 'XLS', reports_contribution_reports_for_project_owners_path(project_id: @project.id, reward_id: 0, format: :xls), class: 'alt-link'
            li.divider.u-marginbottom-10
            - if selected_r.length > 0
                - selected_r.each do |reward|
                  li.fontsize-smaller.u-marginbottom-10
                    div
                      | Apoiadores da recompensa #{reward.display_minimum}
                      br/
                      = link_to 'CSV', reports_contribution_reports_for_project_owners_path(project_id: @project.id, reward_id: reward.id, format: :csv), class: 'alt-link'
                      | &nbsp;\&nbsp;
                      = link_to 'XLS', reports_contribution_reports_for_project_owners_path(project_id: @project.id, reward_id: reward.id, format: :xls), class: 'alt-link'
                  li.divider.u-marginbottom-10
        


/.project-metrics style='width: 980px;'
  h1= t('projects.metrics.titles.confirmed_by_day')
  = line_chart @metrics[:confirmed]
  
  h1= t('projects.metrics.titles.confirmed_amount_by_day')
  = line_chart @metrics[:confirmed_amount_by_day]
  
  h1= t('projects.metrics.titles.address_state')
  br
  .bootstrap-twitter
    table.table.table-bordered.table-striped
      thead
        tr
          th= 'Estado'
          th= 'Total de apoios confirmados'
      tbody
        - @metrics[:address_state].sort{|a,b| b[1] <=> a[1]}.each do |metric|
          tr
            td= metric[0] || 'Internacional'
            td= metric[1]

